package edu.sctu.wulixia.month6.day20150609;

/**
 * Created by user05 on 2015/6/10.
 */
public class Student {
    private String name;
    private int age;

//自定义equals方法，判断两个对象是否相等

    public boolean equals(Student obj) {
        if(obj.name.equals(this.name) && obj.age == this.age){
            return true;
        }else {
            return false;
        }

    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }


}
